<?php
require_once("./DButil.php");

// $videoId=$_REQUEST["videoId"];
$arr=$_SESSION["loginTeacher"];
$courseId=$_REQUEST["courseId"];
$status=$_REQUEST["status"];


if(isset($courseId) && strlen(trim($courseId)) && ($courseId!=0)){
    $whereSql .= " and v.courseId = {$courseId} ";
}
if(isset($status) && strlen(trim($status)) && ($status!=-2)){
    $whereSql .= " and v.status = {$status} ";
}
$sql="select v.videoId,v.videoInfo,c.courseName,v.status
from t_video v
left join t_course c on v.courseId=c.courseId
where v.teacherId='{$arr["teacherId"]}'". $whereSql ;


if (query($sql)) {
    $result=query($sql);
}
else{
$result = [
    "msg" => "未存在",
    "code" => 404,
    "success" => true,
];
}
header("Content-Type:application/json;charset=utf-8");
echo json_encode($result);
?>